<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>
        修改密码
    </title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="js/jquery.js"></script>
    <link href="plugin/artDialog/artDialog/skins/blue.css" rel="stylesheet"/>
    <script src="plugin/artDialog/artDialog/artDialog.min.js" type="text/javascript"></script>
    <script src="plugin/artDialog/artDialog/artDialog.plugins.min.js" type="text/javascript"></script>
    <script src="plugin/artDialog/dialog.js" type="text/javascript"></script>
    <script>
        /*<![CDATA[*/
        $(function () {
            $('#btnSave').click(function () {
                var oldPwd = $('#txtOldPwd').val();
                var newPwd = $('#txtNewPwd').val();
                var conf = $('#txtConfirm').val();

                if (oldPwd == '' || newPwd == '' || conf == '') {
                    showNotice('请填写完整信息');
                    return false;
                }

                if (newPwd != conf) {
                    showNotice('两次新密码不相同');
                    return false;
                }
                changPass(oldPwd, newPwd);

            });

        });
        function changPass(oldPass, newPass) {
            $.ajax({
                type: "post",
                url: "changePass",
                data: {
                    oldPass: oldPass,
                    newPass: newPass
                },
                dataType: "json",
                success: function (data) {
                    if (data.status == 0) {
                        showNotice("修改成功");
                        $('#txtOldPwd').val("");
                        $('#txtNewPwd').val("");
                        $('#txtConfirm').val("");
                    } else {
                        showNotice(data.msg);
                    }
                }
            });
        }
        /*]]>*/
    </script>
</head>
<body>
<form id="form1">


    <div class="place">
        <span>位置：</span>
        <ul class="placeul">
            <li><a href="#">首页</a></li>
            <li><a href="#">系统设置</a></li>
            <li><a href="#">修改密码</a></li>
        </ul>
    </div>

    <div class="formbody">

        <div class="formtitle"><span>修改密码</span></div>

        <ul class="forminfo">
            <li><label>原密码</label>
                <input name="txtOldPwd" type="password" id="txtOldPwd" class="dfinput" style="width:200px;"/>
            </li>
            <li><label>新密码</label>
                <input name="txtNewPwd" type="password" id="txtNewPwd" class="dfinput" style="width:200px;"/>
            </li>
            <li><label>确认密码</label>
                <input name="txtConfirm" type="password" id="txtConfirm" class="dfinput" style="width:200px;"/>
            </li>
            <li><label>&nbsp;</label>
                <input type="button" name="btnSave" value="保存" id="btnSave" class="scbtn"/>
            </li>
        </ul>
    </div>

</form>
</body>
</html>
